package com.example.administrator.jingpingou.bean;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import org.json.JSONException;
import org.json.JSONObject;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by 小吧 on 2016/8/29.
 */
public class Shop_Top {
    /**
     * info : 今日关注上升
     * list : [["电子血压计","电子血压..."],["女保暖内衣","女保暖内..."],["血压计","血压计"],["女式鞋","女式鞋"],["男童棉袄","男童棉袄"],["甩脂机","甩脂机"],["手表女","手表女"],["饮水机","饮水机"],["小米4","小米4"],["保暖内衣","保暖内衣"]]
     */

    private String info;
    private List<List<String>> list;

    public static Shop_Top objectFromData(String str) {

        return new Gson().fromJson(str, Shop_Top.class);
    }

    public static Shop_Top objectFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);

            return new Gson().fromJson(jsonObject.getString(str), Shop_Top.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }

        return null;
    }

    public static List<Shop_Top> arrayShop_TopFromData(String str) {

        Type listType = new TypeToken<ArrayList<Shop_Top>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public static List<Shop_Top> arrayShop_TopFromData(String str, String key) {

        try {
            JSONObject jsonObject = new JSONObject(str);
            Type listType = new TypeToken<ArrayList<Shop_Top>>() {
            }.getType();

            return new Gson().fromJson(jsonObject.getString(str), listType);

        } catch (JSONException e) {
            e.printStackTrace();
        }

        return new ArrayList();


    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public List<List<String>> getList() {
        return list;
    }

    public void setList(List<List<String>> list) {
        this.list = list;
    }
}
